package ${package.Mapper};

import ${package.Entity}.${entity};
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
public interface ${table.mapperName}{
	
	/**
	*  查询表${table.name}所有信息
	*/
	List<${entity}> findAll();

<#list table.fields as field>
<#if field.keyFlag>
	/**
	*  根据主键${field.propertyName}查询表${table.name}信息
	*  @param ${field.propertyName}
	*/
	${entity} getById(@Param("${field.propertyName}")  <#if field.propertyType == "BigDecimal">Long</#if><#if field.propertyType != "BigDecimal">${field.propertyType}</#if> ${field.propertyName});
</#if>
</#list>

	/**
	*  根据条件查询表${table.name}信息
	*  @param ${table.entityPath}
	*/
	List<${entity}> getByCondition(${entity} ${table.entityPath});

<#list table.fields as field>
<#if field.keyFlag>
	/**
	*  根据主键${field.propertyName}查询表${table.name}信息
	*  @param ${field.propertyName}
	*/
	Integer deleteById(@Param("${field.propertyName}") <#if field.propertyType == "BigDecimal">Long</#if><#if field.propertyType != "BigDecimal">${field.propertyType}</#if> ${field.propertyName});
</#if>
</#list>

<#list table.fields as field>
<#if field.keyFlag>
	/**
	*  根据主键${field.propertyName}更新表${table.name}信息
	*  @param ${table.entityPath}
	*/
	Integer updateBySelective(${entity} ${table.entityPath});
</#if>
</#list>

<#list table.fields as field>
<#if field.keyFlag>
	/**
	*  新增表${table.name}信息
	*  @param ${table.entityPath}
	*/
	Integer insertBySelective(${entity} ${table.entityPath});
</#if>
</#list>


<#list table.fields as field>
<#if field.keyFlag>
	/**
	*  分页查询总数
	*/
	Long selectCount(${entity} ${table.entityPath});
</#if>
</#list>

<#list table.fields as field>
<#if field.keyFlag>
	/**
	*  分页查询
	*/
	List<${entity}> selectList(${entity} ${table.entityPath});
</#if>
</#list>
}

